import requests
import json
import os
import dotenv

dotenv.load_dotenv()

url = "https://api.bochaai.com/v1/web-search"

payload = json.dumps({
  "query": "最新的汽车销量排行",
  "freshness": "oneYear",
  "summary": True,
  "count": 8
})
headers = {
  'Authorization': os.getenv("BOCHA_API_KEY"), #'sk-90c29ca28cc6426f8a7b5689f39651db',
  'Content-Type': 'application/json',
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.json())
